import { ref, onMounted, computed } from 'vue'

export default () => {
    let sum = ref(0)
    let bigSum = computed(() => sum.value * 10)

    const add = () => sum.value++

    // 钩子
    onMounted(() => add())

    // 给外部提供东西
    return { sum, bigSum, add }
}